package com.good.product.server.controller;

import com.good.common.vo.ResultData;
import com.good.product.server.model.ProductInfo;
import com.good.product.server.service.ProductInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @packageName: com.good.product.server.controller
 * @description:
 * @author: cuiP
 * @date: 2018/5/20 22:51
 * @version: V1.0.0
 */
@Slf4j
@RestController
@RequestMapping("/products")
public class ProductInfoController {

    @Resource
    private ProductInfoService productInfoService;

    @GetMapping
    public ResponseEntity<ResultData> list() {
        ProductInfo productInfo = productInfoService.selectById(1);
        return ResponseEntity.ok(new ResultData(200, "", productInfo));
    }

}
